package com.njwb.day15.zqzb.method.review;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;

public class TestDemo01 {

    public static void main(String[] args) {

        Class[] clss = {String.class,StringBuffer.class, ArrayList.class} ;
        for (Class cls :clss) {
            printStructorOfClass(cls);
        }
    }

    public static void printStructorOfClass(Class cls) {
        System.out.println(cls.getName()+"类的结构如下:");
        Constructor[] declaredConstructors = cls.getDeclaredConstructors();
        for(Constructor c:declaredConstructors) {
            System.out.println(c);
        }
        System.out.println("******************************************");
        Field[] declaredFields = cls.getDeclaredFields();
        for(Field field:declaredFields) {
            System.out.println(field);
        }
        System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        Method[] methods = cls.getDeclaredMethods();
        for(Method m:methods) {
            System.out.println(m);
        }
        System.out.println("=============================================================================");
    }
}
